function* f() {
    for(var i = 0; true; i++) {
        var reset = yield i;
        if(reset){i = -1}
    }
}

function* foo(x) {
    var y = 2 * (yield (x + 1));
    var z = yield(y/3);
    return (x+y+z);
}
var a = foo(5);
// console.log(a.next())

function* dataConsumer() {
    console.log('Started');
    console.log(`1. ${yield}`);
    console.log(`1. ${yield}`);
    return `result`;
}

let genObj = dataConsumer();
console.log(genObj.next());
console.log(genObj.next('a'));
console.log(genObj.next('b'));